home *** CD-ROM | disk | FTP | other *** search
- #include <Amiga.h>
- #include <utility/hooks.h>
-
- /************************************************************************/
-
- #if defined(__SASC)
-
- ULONG __SAVEDS __asm MyHookEntry(register __a0 struct Hook *Hook,
- register __a2 APTR Object,
- register __a1 APTR Message)
-
- {
- return Hook->h_SubEntry(Hook,Object,Message);
- }
-
- /************************************************************************/
-
- #elif defined(__GNUC__)
-
- __asm("
- .text
- .globl _MyHookEntry
- _MyHookEntry:
- "
- #ifdef SMALL_DATA
- " movml a4/a1,SP@-
- "
- #else
- " movl a1,SP@-
- "
- #endif
- " movml a2/a0,SP@-
- "
- #ifdef SMALL_DATA
- #ifdef SMALL_CODE
- " jsr PC@(__geta4+2)
- "
- #else
- " jsr __geta4
- "
- #endif
- #endif
- " movl a0@(12),a0
- jsr a0@
- lea SP@(12),SP
- "
- #ifdef SMALL_DATA
- " movl SP@+,a4
- "
- #endif
- " rts
- ");
-
- /************************************************************************/
-
- #else
- #error Compiler not supported
- #endif
-